1. Field of the Invention
The present invention relates to a method of detecting response time-out based on master-slave protocol architecture. By means of calculating the precise response time-out from response time-outs which are gotten from the slave device respond to a predetermined number of Modbus requests and then applying the precise response time-out to the formal master/slave communication time period, the master device can give EXECUTE instruction or command at the accurate time point.
2. Description of the Related Art
Following fast development of communication technology, communication networks have also been well developed. LAN (Local Area Network) and WAN (Wide Area Network) are categorized subject to their scope and scale. A LAN connects network devices over a relatively short distance. A WAN is a geographically-dispersed collection of LANs. The Internet is the largest WAN, spanning the Earth.
Either in LAN or WAN, Ethernet has proven itself as a relatively inexpensive, reasonably fast, and very popular LAN technology. Ethernet cables (fiber optics or twisted pair) are limited in their reach, and these distances are insufficient to cover medium-sized and large network installations. Therefore, repeaters are used in Ethernets. A repeater in Ethernet networking is a device that allows multiple cables to be joined and greater distances to be spanned. A bridge device can join an Ethernet to another network of a different type, such as a wireless network. Popular types of repeater devices are Ethernet hubs, switches and routers. By means of the combination of Ethernet cables with hubs, switches and/or routers, an Ethernet networking allows transmission or control of data or instructions among different LANs, computers, and/or other devices such as surveillance systems, security systems, automation systems, etc.
Further, there is known a network communication architecture commonly seen in industrial control and device communication protocol or rules, i.e., Modbus. Modbus is a serial communications protocol published by Modicon in 1979 for use with its programmable logic controllers (PLCs). It has become a standard communications protocol in industry, and is now the most commonly available means of connecting industrial electronic devices. The first main reason for the extensive use of Modbus over other communications protocols is that Modbus is openly published and royalty-free. The second main reason is that Modbus can be implemented in days, not months. Modbus moving raw bits or words without placing many restrictions on vendors is the third main reason.
However, because Modbus is a master/slave protocol, the master device must poll the slave devices one by one but cannot bi-directionally communication with all the slave devices at a same time. Further, every slave device connected to the master device has a unique address for allowing accurate communication with the master device. Either the other slave devices have received the instruction or request from the master device or have not received any instructions or requests, only the slave device to be in communication with the master device will process the instruction or request given by the master device.
Because Modbus is a master/slave protocol and because the master device must poll the slave devices one by one, it is important to know accurately the response time-out when the master device gives a request to the slave device. Currently slave response time-out is measured by the user's rule of experience, or trial and error. However, this nonprecise verification method tends to obtain an inaccurate response time-out. Further, manual verification is time consuming and costly. Setting of improper response time-out may cause the system unable to function. For example, in a regular industrial manufacturing line (such as wafer plant, plastic materials plant), if the slave device cannot give the instruction on accurate time due to that the response time-out required for the slave device is not accurately obtained, or if the slave device cannot execute the master device's command at accurate time point, an abnormality or interruption of the manufacturing line may occur, resulting in paralysis or damage of the machinery of the industrial manufacturing line. Further, the temperature control, emergency exit system and other control actions in a building control need to make an accurate response at accurate time point. If responding tactics cannot be started at accurate time point, it will get no help in reducing the risk of disaster and the loss resulted from such disaster.
Therefore, it is desirable to provide a method of detecting master/slave response time-out under master-slave communications architecture that eliminates the aforesaid problem.